home *** CD-ROM | disk | FTP | other *** search
/ Aminet 39 / Aminet 39 (2000)(Schatztruhe)[!][Oct 2000].iso / Aminet / util / cli / TitleCD.lha / TitleCD.doc < prev    next >
Encoding:
Text File  |  2000-07-01  |  9.6 KB  |  289 lines

  1. Short:     CD replacement (wildcards, window title)
  2. Author:    soenke@kino-fahrplan.de (Sönke Tesch)
  3. Uploader:  soenke@kino-fahrplan.de
  4. Type:      util/cli
  5. Replaces:  util/dir/TitleCD.lha
  6. Keywords:  CD Modula-2
  7. Interface: Shell CLI
  8.  
  9. TitleCD is a replacement for the original CD shell command. I wasn`t that
  10. happy with the way the Shell usually displays the current directory because
  11. it usually  resulted in annoying long prompts of 1/2 to 2/3 times of the
  12. total width of the shell window. The window title however remained unused..
  13.  
  14. The whole thing has been extended with wildcard support, an argument that
  15. speeds up changing between the current and the last directory ("cd lastdir"
  16. instead of "cd sys:bla/blo/ble/bli") and writing/reading the directory to
  17. or from a file.
  18.  
  19. In this release, apart from two exterminated bugs, TitleCD has been extended
  20. with history functions.
  21.  
  22. Due to several requests, a version without the title-setting-feature is
  23. also available. It's available as HistoryCD, also from Aminet:util/cli.
  24.  
  25.  
  26. Installation
  27. ============
  28.  
  29.   Only three steps to heaven:
  30.  
  31.   a) 'copy TitleCD to c:cd'
  32.  
  33.      Due to limitations of the Shell commands set and get (see "Environment
  34.      variables" below) you should also
  35.  
  36.      'copy get to c:'
  37.  
  38.   b) Add the lines
  39.  
  40.        resident cd remove
  41.        resident get remove
  42.  
  43.      to your s:user-startup to disable the build-in commands CD and get of
  44.      the shell.
  45.  
  46.   c) Reboot, or execute the lines from b) manually.
  47.  
  48.   That`s it :)
  49.  
  50.   If you want to you can make TitleCD resident but this is not necessary
  51.   unless you`re using a floppy-disc-based system. You will not notice any
  52.   speed difference with harddisks.
  53.  
  54.  
  55. How to use
  56. ==========
  57.  
  58.   TitleCD DIR,TO/K,FROM/K,LASTDIR/S,NEXT/S,PREV/S,FIRST/S,LAST/S,NOTITLE/S
  59.  
  60.   DIR
  61.     New current directory - same as in the original but TitleCD also
  62.     supports wildcards e.g. "cd sys:#?/pri#?" will most likely cd to
  63.     "sys:devs/printers" (unless "sys:letters/private" appears first).
  64.     TitleCD chooses the first directory that matches your pattern. If
  65.     this is not the needed one simply be a bit more precise next try.
  66.  
  67.   TO/K
  68.     If this appears in the arguments TitleCD writes the name of the
  69.     current directory to this file. No newline is appended!
  70.  
  71.   FROM/K
  72.     If this appears in the arguments TitleCD reads the name of the new
  73.     current directory from this file.
  74.  
  75.   LASTDIR/S
  76.     If set TitleCD switches back to the last directory you have been to.
  77.  
  78.     Example:
  79.  
  80.       1.ram:env/system/EggPaint> cd sys:graphics/EggPaint
  81.       1.sys:graphics/EggPaint> cd lastdir
  82.       1.ram:env/system/EggPaint>
  83.  
  84.   NEXT/S,PREV/S
  85.     Move to the next or previous directory in the history buffer. See
  86.     below for detailed instructions.
  87.  
  88.   FIRST/S,LAST/S
  89.     Move to the first or last directory in the history buffer. See
  90.     below for detailed instructions.
  91.  
  92.   NOTITLE/S
  93.     If set the title of the Shell window will not be changed.
  94.  
  95.  
  96.   The options TO and especially FROM might not be very useful at first,
  97.   however they will come handy to move back to the original directory
  98.   after executing some script, for example.
  99.  
  100.  
  101.   Directory History
  102.   -----------------
  103.  
  104.   TitleCD keeps track of all directories your have visited using a FIFO
  105.   (first in, first out) buffer of 1024 bytes.
  106.  
  107.   You can check parts of the contents of this buffer with the Shells' set
  108.   command (Shell's get will -not- work, use the get included in this
  109.   archive instead), just have a look at local environment variable
  110.   DirHistory:
  111.  
  112.     5> set
  113.     CurrentDir        Ram Disk:
  114.     DirHistory           0 evoSonic:Spiele
  115.        1 evoSonic:
  116.     >  2 Ram Disk:
  117.        3 evoSonic:sprachen/Cyclone/Programme/TitleCD
  118.     LastDir           evoSonic:Spiele
  119.  
  120.   The current directory is always marked with a ">" (number 2 in the
  121.   example above).
  122.  
  123.   New directories move in on top of this list, so in our example, we have
  124.   first been to entry 3, then 2, 1, 0 and now moved back in history to
  125.   number 2.
  126.  
  127.   Note: Please also have a look at "Environment variables" below.
  128.  
  129.   To use the history functions it`s important to know that the newest
  130.   entry is on top of the list and the oldest at it`s end. The functions
  131.   move in "time", i.e. to a directory visited later or earlier, not in
  132.   "space", i.e. up and down in this list (although this seems to be the
  133.   same if you had just a quick look).
  134.  
  135.   There are four arguments to control your movement in the history list,
  136.   the list of recently visited directories:
  137.  
  138.     NEXT, PREV
  139.  
  140.       NEXT and PREV move forwards or backwards in the list.
  141.  
  142.       Moving forwards means moving forward in time, towards the top of
  143.       the list, towards the newest entry in the list, to the next entry
  144.       you visited from the current directory in the list.
  145.  
  146.       Previous means moving backward in time, towards the end of the
  147.       list, towards the oldest entry, to the directory you visited
  148.       prevously, before the current directory in the list.
  149.  
  150.     FIRST, LAST
  151.  
  152.       FIRST brings you to the first entry in the list, LAST to the last.
  153.  
  154.       The first entry is -not- the one on top of the list, but the one
  155.       that has been added first to it, the oldest entry.
  156.       The last entry is the latest one added, the one on top of the list.
  157.  
  158.   You may also move more than one step at a time:
  159.  
  160.     5> TitleCD next 2
  161.  
  162.   brings us to the directory number 0 in the example above (we`re now in
  163.   directory 2, the next one would be 1, the second next one is 0).
  164.  
  165.   This option of course also works with PREV, FIRST and LAST.
  166.  
  167.   The history feature does not interfere with LASTDIR. LASTDIR keeps
  168.   working as it always did.
  169.  
  170.  
  171.   This all seems to be a bit too complicated? Just give it a try, learning
  172.   by doing is the still best way to figure something out :)
  173.  
  174.  
  175. Environment Variables
  176. =====================
  177.  
  178.   TitleCD sets/uses two local variables:
  179.  
  180.     LastDir    - the name of the last current directory
  181.     CurrentDir - the name of the current current directory
  182.     DirHistory - the list of directories you`ve been in
  183.  
  184.   LastDir is actually used for the LASTDIR argument, DirHistory is the
  185.   buffer for the history functions.
  186.  
  187.   You can use the shell commands set and get to access these (see AmigaDOS
  188.   manual), however both of them have some limitations:
  189.  
  190.   - set shows only a small portion of the whole contents of a variable.
  191.     After having traveled a while around your disks, you'll notice that
  192.     set returns something like this:
  193.  
  194.     1> set
  195.     DirHistory           0 evoSonic:sprachen/Cyclone/modules/txt
  196.        1 evoSonic:sprachen/Cyclone/modules
  197.        2 evoSonic:sprachen/Cyclone/modules/txt
  198.     >  3 evoSonic:sprachen/Cyclone/Programme/TitleCD
  199.        4 evoSonic:
  200.        5 Ram Disk:
  201.        6 evoSonic:sprachen/Cy
  202.     1>
  203.  
  204.     Only one half of entry 6 is displayed, and there might be more entries
  205.     stored in the variable, but set doesn't display them.
  206.  
  207.   - get is even a bit worse, it only displays the first line of a variable.
  208.     DirHistory from above would be displayed as follows:
  209.  
  210.     1> get DirHistory
  211.     0 evoSonic:sprachen/Cyclone/modules/txt
  212.     1>
  213.  
  214.   To get around these limitations, copy the command get from this archive
  215.   to c: and add 'resident get remove' to your user-startup.
  216.  
  217.  
  218. Copyright
  219. =========
  220.  
  221.   TitleCD, TitleCD.readme and TitleCD.doc:
  222.    Copyright 1993-2000 by Sönke Tesch
  223.    All Rights Reserved.
  224.  
  225.   You may re-distribute the archive as long as no file is removed or
  226.   changed.
  227.   TitleCD has to be distributed for FREE, any other kind of distribution
  228.   without my written permission is not allowed. However, this is not
  229.   the case for any Aminet-CD. Others please feel free to ask.
  230.   I do not give any guarantee for the quality and usefulness of this
  231.   programm, nor that it works as described or fits particular needs.
  232.  
  233.  
  234. Contact
  235. =======
  236.  
  237.   Comments, suggestions, questions, bug-reports and Hey-I-use-it!-mails
  238.   are always welcome! Just write to <soenke@kino-fahrplan.de>.
  239.  
  240.  
  241. Those finer details..
  242. =====================
  243.  
  244.   TitleCD is written using Cyclone Modula-2 by Marcel Timmermans.
  245.   The source of TitleCD is available on request, just ask.
  246.  
  247.  
  248.   Also have a look at Find, a file finder for the shell. You can find
  249.   Find at Aminet:util/cli/Find_v203.lha
  250.  
  251.  
  252. History
  253. =======
  254.  
  255.    The first version was born sometime back in 1993, written using the
  256.    DevPac assembler. After M2Amiga Modula-2 had been massively improved
  257.    I used that language again.
  258.    Version 3 was completely re-written using Cyclone Modula-2.
  259.  
  260.    Changes from 4.00 to 4.1:
  261.    + Moving in the history buffer did not work correctly. First time
  262.      was ok, but the next move removed all entries newer than the
  263.      current one. This means you could actually just move backwards.
  264.      Is this a case for Emmett Brown?
  265.    + TitleCD now tries to get the real Shell window, instead of using
  266.      the one that Intuition reports to be currently active. Cost me
  267.      another ~180 bytes (which is the reason why I didn't implement
  268.      this routine earlier).
  269.    + The "broken contents" of the history variable DirHistory was not
  270.      the fault of TitleCD but of set. See "Environment variables"
  271.      above.
  272.      Included fixed get command to solve this problem.
  273.  
  274.    Changes from 3 to 4:
  275.    + History.
  276.    + The routine that calculates the width of the shell window title
  277.      now really does calculate.
  278.      Earlier versions just did some "well, this might be something
  279.      from here minus something from there", not taking into account
  280.      the windows' gadgets and probably also using the wrong font.
  281.    + If the FROM-file contained newlines this option would not work
  282.      since the length calculation was somehow broken.
  283.      Unfortunatly even if fixed FROM would not work with files that
  284.      contain more than one line. Completely re-written that part.
  285.  
  286. Have fun,
  287.   soenke (20-Jun-2000, 12-Jun-2000, 6-Aug-97)
  288.  
  289.